<template>
  <div class="message">
    <el-popover placement="bottom" :width="310" trigger="click">
      <template #reference>
        <el-badge :value="activeLists.length" class="item" @click="func">
          <i :class="'iconfont icon-xiaoxi'" class="toolBar-icon"></i>
        </el-badge>
      </template>
      <el-tabs v-model="activeName">
        <el-tab-pane :label="`通知(${activeLists.length})`" name="first" v-for="(item,index) in activeLists" :key="index">
          <div class="message-list">
            <div class="message-item">
              <img src="@/assets/images/msg01.png" alt="" class="message-icon" />
              <div class="message-content">
                <span class="message-title">客户名称:{{item.customerName}}</span>
                <span class="message-title">客户电话:{{item.customerId}}</span>
                <span class="message-title">负责人:{{item.director}}</span>
                <span class="message-title">跟进人:{{item.followUp}}</span>
                <span class="message-date">距离当前阶段剩余{{item.Timereman}}天</span>
              </div>
            </div>
          </div>
        </el-tab-pane>
      </el-tabs>
    </el-popover>
  </div>
</template>

<script setup>
import { ref,reactive } from "vue";
import { useUserStore } from "@/stores/modules/user";
const activeName = ref("first");
const userStore = useUserStore();
const activeLists = reactive(userStore.activeList);
</script>

<style scoped lang="scss">
.message-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 260px;
  line-height: 45px;
}
.message-list {
  display: flex;
  flex-direction: column;
  .message-item {
    display: flex;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--el-border-color-light);
    &:last-child {
      border: none;
    }
    .message-icon {
      width: 40px;
      height: 40px;
      margin: 0 20px 0 5px;
    }
    .message-content {
      display: flex;
      flex-direction: column;
      .message-title {
        margin-bottom: 5px;
      }
      .message-date {
        font-size: 12px;
        color: var(--el-text-color-secondary);
      }
    }
  }
}
</style>
